#!/bin/bash

yum -y install libaio;
wget http://47.114.163.161:8087/mysql/mysql-5.7.37-1.el7.x86_64.rpm-bundle.tar;
tar -xvf mysql-5.7.37-1.el7.x86_64.rpm-bundle.tar;
rpm -ivh mysql-community-common-5.7.37-1.el7.x86_64.rpm;
rpm -ivh mysql-community-libs-5.7.37-1.el7.x86_64.rpm;
rpm -ivh mysql-community-client-5.7.37-1.el7.x86_64.rpm;
rpm -ivh mysql-community-server-5.7.37-1.el7.x86_64.rpm;
rpm -ivh mysql-community-devel-5.7.37-1.el7.x86_64.rpm;

service mysqld start;

#############
#创建hive用户
create database if not exists hive_metadata;
grant all privileges on hive_metadata.* to 'hive'@'%' identified by '@Hadoop123456';
grant all privileges on hive_metadata.* to 'hive'@'localhost' identified by '@Hadoop123456';
grant all privileges on hive_metadata.* to 'hive'@'spark1' identified by '@Hadoop123456';
flush privileges;
use hive_metadata;
#############